import { faker } from "@faker-js/faker";
import { useEffect, useState } from "react";
import Button from "../components/Button";

export default function WatchDemo() {
  const [name, setName] = useState("watch demo");

  useEffect(() => {
    console.log("new name: ", name);
  }, [name]);

  const changeName = () => {
    setName(faker.person.firstName());
  };

  return (
    <div>
      <Button onClick={changeName}>Change</Button>
      {name}
    </div>
  );
}
